package org.cloudfoundry.samples;

import javax.inject.Inject;

import org.cloudfoundry.samples.domain.UserReg;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Handles requests for the application home page.
 */
@Controller
public class UserController {

	private static final Logger logger = LoggerFactory.getLogger(UserController.class);

	@Inject
	private ReferenceDataRepository referenceRepository;

    @RequestMapping(value = "/listreguser/{deviceid}", method = RequestMethod.GET, produces = "application/json")
    public @ResponseBody UserReg listRegUser(@PathVariable String deviceid) {
        logger.info("listcustomerlocations...");
        
        return referenceRepository.listRegUser(deviceid);
        
    }
    
}
